<script lang="ts">
  import { defineComponent, h } from 'vue';
  import { useRouter } from 'vue-router';
  export default defineComponent({
    setup() {
      const router = useRouter();
      const { params, query } = router.currentRoute.value;
      const { path } = params;
      router.replace({ path: '/' + path, query });

      // 返回一个 render 函数
      return () => {
        h('div');
      };
    },
  });
</script>
